﻿@model DiscussProject.Models.Article
@{
    ViewBag.Title = "Detail2";
    Layout = "~/Views/Shared/_ArticleLayout.cshtml";
}
@section showinfo{
    <cite class="layui-hide-xs">@ViewBag.myinfo.Name</cite>
    <img src="@Session["head_img"]">
}

<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8 content detail">
            <div class="fly-panel detail-box">
                <h1>@Model.Title</h1>
                <!-- 发帖人信息 -->
                <div class="detail-about">
                    <a class="fly-avatar" href="../user/home.html">
                        <img src="@Model.Author.Picture" alt="@Model.Author.Name">
                    </a>
                    <div class="fly-detail-user">
                        <a href="../user/home.html" class="fly-link">
                            <cite>@Model.Author.Name</cite>
                        </a>
                        <span>@Model.CreateTime</span>
                    </div>
                </div>
                <!-- 帖子内容 -->
                <div class="detail-body photos">
                    @Model.Content
                </div>
            </div>

            <div class="fly-panel detail-box" id="flyReply">
                <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
                    <legend>回帖</legend>
                </fieldset>

                <ul class="jieda" id="jieda">
                    @foreach (var item in (IEnumerable<DiscussProject.Models.Comment>)ViewData["comments"])
                    {
                        <li data-id="111" class="jieda-daan">
                            <a name="item-1111111111"></a>
                            <div class="detail-about detail-about-reply">
                                <a class="fly-avatar" href="">
                                    <img src="@item.User.Picture" alt=" ">
                                </a>
                                <div class="fly-detail-user">
                                    <a href="" class="fly-link">
                                        <cite>@item.User.Name</cite>
                                    </a>

                                    <span>(楼主)</span>
                                </div>

                                <div class="detail-hits">
                                    <span>@item.CreateTime</span>
                                </div>
                            </div>
                            <div class="detail-body jieda-body photos">
                                <p>@item.Content</p>
                            </div>
                            <div class="jieda-reply">
                                <span class="jieda-zan zanok" type="zan">
                                    <i class="iconfont icon-zan"></i>
                                    <em>0</em>
                                </span>
                                <span type="reply">
                                    <i class="iconfont icon-svgmoban53"></i>
                                    回复
                                </span>
                                <div class="jieda-admin">
                                    <span type="edit">编辑</span>
                                    <span type="del"><a href="/Comments/Delete2?id=@item.Id&articleId=@Model.Id">删除</a></span>
                                    <span class="jieda-accept" type="accept">采纳</span>
                                </div>
                            </div>
                        </li>
                    }
                </ul>

                <div class="layui-form layui-form-pane">
                    @using (Html.BeginForm("SubmitComment", "Articles"))
                    {
                        <div class="layui-form-item layui-form-text">
                            <a name="comment"></a>

                            <div class="layui-input-block">

                                @Html.TextArea("content", "", new
                                {
                                    id = "L_content",
                                    name = "content",
                               lay_verify = "required",
                                    placeholder = "请输入内容",
                                      @class = "layui-textarea fly-editor",
                                    style = "height: 150px;"
                                })

                                @*<textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容"
                                    class="layui-textarea fly-editor" style="height: 150px;"></textarea>*@
                            </div>
                        </div>
                        <div class="layui-form-item">
                            @Html.Hidden("articleId", Model.Id)
                            @*<input type="hidden" name="jid" value="123">*@
                            <button class="layui-btn" id="ab" lay-filter="*" lay-submit>提交回复</button>
                        </div>
                    }
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="fly-panel" style="padding: 20px 0; text-align: center;">
                <img src="/fly-master/res/images/weixin.jpg" style="max-width: 100%;" alt="layui">
                <p style="position: relative; color: #666;">广州中医药大学</p>
            </div>

        </div>
    </div>
</div>
@Scripts.Render("~/bundles/jquery")
<script>
    $('#ab').click(function () {
        window.location.reload()
    })
</script>

